home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / eaissu3b.lha / Source_Code / AK_Colourshifting_Text.AMOS / AK_Colourshifting_Text.amosSourceCode
AMOS Source Code  |  1995-12-30  |  2KB  |  66 lines

  1. ' Colourshifting text routine
  2. '
  3. ' Uses a Spectrum colour palette of 8 colours. 
  4. ' Text colours can "Appear" to move to either the left or right
  5. '  By changing the value in CSTE to 1 or 0.
  6. ' This is configured for a Hi resolution screen. Change CHARW to 40 for a  
  7. '  Low resolution screen.
  8. ' CSTA is the first colour in the palette to be displayed on the screen. 
  9. ' Feel free to use in your own programs. 
  10.  
  11. Default Palette $0,$F,$F00,$F0F,$F0,$FF,$FF0,$FFF
  12. Global TEX$,CHARW,POSY,CSTA,CSTE
  13.  
  14. Screen Open 0,640,255,8,Hires : Paper 0 : Cls : Curs Off : Flash Off 
  15. Shift Up 2,1,7,1 : Rem first 10 Colours 
  16. CHARW=80 : Rem 40 chars width max 
  17.  
  18. DAT:
  19. Data "How do you like this ?","based on an idea done by Carl"
  20. Data "Drinkwater in FAIRYCAKE 22"," ","You like it?"," "
  21. Data "It uses a simple Speccy palette,","and makes use of the SHIFT"
  22. Data "command."," "
  23. Data "If you are a keen AMOS programmer,","and want to get some good source"
  24. Data "or programs, then MUSHROOM PD is the","place to begin looking."," "
  25. Data "This library is dedicated entirely","to AMOS."," "
  26. Data "write to this address for info :"," "
  27. Data "Andrew MUSHROOM Kellett","32 Castleton Crescent","Gamesley"
  28. Data "Glossop","Derbyshire","SK13 9TH","ENGLAND","*"
  29. Restore 
  30. Read TEX$ : CSTE=0 : POSY=2
  31.  
  32. Repeat 
  33.    If CSTE=1 Then CSTA=1
  34.    If CSTE=0 Then CSTA=1
  35.    Proc _COLOURTEXT
  36.    If CSTE=1 Then CSTE=0 : Goto NXT
  37.    If CSTE=0 Then CSTE=1
  38.    NXT:
  39.    Read TEX$ : Inc POSY
  40. Until TEX$="*"
  41.  
  42. Repeat 
  43. Until Mouse Click
  44.  
  45. Procedure _COLOURTEXT
  46.    POSX=(CHARW-Len(TEX$))/2
  47.    For N=0 To Len(TEX$)-1 : I$=Mid$(TEX$,N+1,1)
  48.       Locate POSX+N,POSY : Pen CSTA : Print I$
  49.       If CSTE=1
  50.          If I$<>" "
  51.             Inc CSTA
  52.             If CSTA=8
  53.                CSTA=1
  54.             End If 
  55.          End If 
  56.       End If 
  57.       If CSTE=0
  58.          If I$<>" "
  59.             Dec CSTA
  60.             If CSTA=0
  61.                CSTA=7
  62.             End If 
  63.          End If 
  64.       End If 
  65.    Next N
  66. End Proc